import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;


public class customizedxpath {

	public static void main(String[] args) {
		
		
		WebDriver driver = new FirefoxDriver();
		driver.get("http:www.facebook.com");
		
// WRITING CUSTOMIZED PATH WHEN OBJECTS ARE DYNAMIC & SYNTAX = //tagname[@attribute='value']
//INVOKE FIREBUG & SELECT XPATH AND CLICK ON LOGIN BUTTON(not box)AND FOLLOWING LINE WILL BE HIGHLIGHTED	
//<input id="u_0_n" type="submit" tabindex="4" value="Log In"/>
//SO THERE IS 1 TAGNAME(INPUT) AND 4 ATTRIBUTE (ID,TYPE,TABINDEX,VALUE)with 4 values(u0n,submit,4,Log In) 
//choose any one attribute with its value example SYNTAX WILL BE //input[@type='submit']		
		
		//ENTER LOGIN ID => ENTER PASSWORD=> CLICK ON LOGIN BUTTON //
		
		driver.findElement(By.xpath("//input[@id='email']")).sendKeys("sarabjit115@yahoo.com");
		driver.findElement(By.xpath("//input[@id='pass']")).sendKeys("kushpreet");
		driver.findElement(By.xpath("//input[@type='submit']")).click();
		

	}

}
